package com.ruoyi.web.controller.manage;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.manage.domain.LocationAll;
import com.ruoyi.manage.service.ILocationAllService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 定位信息Controller
 * 
 * @author ruoyi
 * @date 2021-01-07
 */
@RestController
@RequestMapping("/manage/locationAll")
public class LocationAllController extends BaseController
{
    @Autowired
    private ILocationAllService locationAllService;

    /**
     * 查询定位信息列表
     */
    @PreAuthorize("@ss.hasPermi('manage:locationAll:list')")
    @GetMapping("/list")
    public TableDataInfo list(LocationAll locationAll)
    {
        startPage();
        List<LocationAll> list = locationAllService.selectLocationAllList(locationAll);
        return getDataTable(list);
    }

    /**
     * 导出定位信息列表
     */
    @PreAuthorize("@ss.hasPermi('manage:locationAll:export')")
    @Log(title = "定位信息", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(LocationAll locationAll)
    {
        List<LocationAll> list = locationAllService.selectLocationAllList(locationAll);
        ExcelUtil<LocationAll> util = new ExcelUtil<LocationAll>(LocationAll.class);
        return util.exportExcel(list, "locationAll");
    }

    /**
     * 获取定位信息详细信息
     */
    @PreAuthorize("@ss.hasPermi('manage:locationAll:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return AjaxResult.success(locationAllService.selectLocationAllById(id));
    }

    /**
     * 新增定位信息
     */
    @PreAuthorize("@ss.hasPermi('manage:locationAll:add')")
    @Log(title = "定位信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody LocationAll locationAll)
    {
        return toAjax(locationAllService.insertLocationAll(locationAll));
    }

    /**
     * 修改定位信息
     */
    @PreAuthorize("@ss.hasPermi('manage:locationAll:edit')")
    @Log(title = "定位信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody LocationAll locationAll)
    {
        return toAjax(locationAllService.updateLocationAll(locationAll));
    }

    /**
     * 删除定位信息
     */
    @PreAuthorize("@ss.hasPermi('manage:locationAll:remove')")
    @Log(title = "定位信息", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(locationAllService.deleteLocationAllByIds(ids));
    }
}
